]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Specify anchor when deleting characters via timeout
authorSebastian Keller <skeller@gnome.org>
Fri, 15 Mar 2024 10:52:37 +0000 (11:52 +0100)
committerSebastian Keller <skeller@gnome.org>
Fri, 15 Mar 2024 10:52:37 +0000 (11:52 +0100)
6e80f858c dropped the second cursor argument used as anchor when calling
the delete function from the timeout. This was causing the early check
that was trying to detect when deleting from the beginning of the text
to fail, because anchor was now undefined.

Fixes: 6e80f858c ("keyboard: Move backspace key handling to KeyboardController")
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7484
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3239>

js/ui/keyboard.js

index 00f262668891791d34ebb4fcce47b34f9f3dc340..73ff1d212a4c3de1d59ab7331eab15dd2a4edbf0 100644 (file)
@@ -2189,7 +2189,7 @@ class KeyboardController extends Signals.EventEmitter {
                         }
                         this._surroundingUpdateTimeoutId =
                             GLib.timeout_add(GLib.PRIORITY_DEFAULT, KEY_RELEASE_TIMEOUT, () => {
-                                func(text, cursor);
+                                func(text, cursor, cursor);
                                 this._surroundingUpdateTimeoutId = 0;
                                 return GLib.SOURCE_REMOVE;
                             });